﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Version2
{
    public class SearchParameters
    {
        public int ID;
        public String Address;
        public Double Latitude;
        public Double Longitude;
        public Double Radius;
        public DateTime DateAndTime;
        public Double MinutesBeforeAndAfter;
        public SearchParameters() { }

        public SearchParameters(SearchParameters from)
        {
            ID = from.ID;
            Address = from.Address;
            Latitude = from.Latitude;
            Longitude = from.Longitude;
            Radius = from.Radius;
            DateAndTime = from.DateAndTime;
            MinutesBeforeAndAfter = from.MinutesBeforeAndAfter;
        }

        public override bool Equals(object obj)
        {
            SearchParameters other = null;
            try
            {
                other = (SearchParameters)obj;
            }
            catch
            {
                return false;
            }

            return (this.Address == other.Address &&
                        this.Latitude == other.Latitude &&
                        this.Longitude == other.Longitude &&
                        this.Radius == other.Radius &&
                        this.DateAndTime == other.DateAndTime &&
                        this.MinutesBeforeAndAfter == other.MinutesBeforeAndAfter);
        }
    }
}
